<template>
  <a-card :loading="loading" :body-style="{ padding: '0px' }" :bordered="false">
    <div class="chart-card-header">
      <div class="meta">
        <span class="chart-card-title">{{ title }}</span>
        <span class="chart-card-action">
          <slot name="action"></slot>
        </span>
      </div>
    </div>
    <div class="chart-card-content">
      <slot></slot>
    </div>
  </a-card>
</template>

<script>
export default {
  name: 'ModelCard',
  props: {
    title: {
      type: String,
      default: '',
    },
    loading: {
      type: Boolean,
      default: false,
    },
  },
}
</script>

<style lang="less" scoped>
.ant-card {
  height: 100%;

  /deep/ .ant-card-body {
    height: 100%;

    .chart-card-header {
      position: relative;
      overflow: hidden;
      width: 100%;
      margin-bottom: 10px;
      .meta {
        // border-top: 3px solid #3154a4;
        position: relative;
        overflow: hidden;
        padding: 10px;
        width: 100%;
        color: rgb(69, 141, 248);
        // background-color: rgb(248, 248, 248);
        font-size: 14px;
        line-height: 22px;
      }
    }

    .chart-card-action {
      color: #000;
      cursor: pointer;
      position: absolute;
      top: 10px;
      right: 10px;
    }

    .chart-card-title {
      color: #000;
    }
    .chart-card-content {
      position: relative;
      height: calc(100% - 44px);
      width: 100%;
    }
  }
}
</style>